package com.domain.oa.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("用户信息")
@TableName("sys_user")
public class User implements Serializable {

    @ApiModelProperty("用户ID")
    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("用户名")
    @TableField("username")
    private String username;

    @ApiModelProperty("密码")
    @TableField("password")
    private String password;

    @ApiModelProperty("昵称")
    @TableField("nick_name")
    private String nickName;

    @ApiModelProperty("真实姓名")
    @TableField("real_name")
    private String realName;

    @ApiModelProperty("手机号")
    @TableField("phone")
    private String phone;

    @ApiModelProperty("邮箱")
    @TableField("email")
    private String email;

    @ApiModelProperty("地址")
    @TableField("address")
    private String address;

    @ApiModelProperty("权限id")
    @TableField("role_id")
    private Integer roleId;


    @ApiModelProperty("创建账号时间")
    @TableField("create_time")
    private Date createTime;

    @ApiModelProperty("编辑用户信息时间")
    @TableField("update_time")
    private Date updateTime;

    @ApiModelProperty("是否逻辑删除")
    @TableField("is_delete")
    private String isDelete;

    @ApiModelProperty("当前用户Token信息")
    // 空值就忽略
    @JsonInclude(JsonInclude.Include.NON_DEFAULT)
    // 数据库中没有该值,但是需要使用,用来存放临时Token,实现单点登录
    @TableField(exist = false)
    private String token;
}
